1. Technical Field
The present invention is directed to an apparatus and method for selecting a web service in response to a request from a client device. More specifically, the present invention is directed to mechanisms for determining when and from what source a web service implementation is to be identified for use by a client device in accessing a web service.
2. Description of Related Art
In service-oriented architectures, the fundamental premise is the reuse of web services across one or more enterprise applications. Web services are services that are offered across the Internet that are built using standard technologies that allow interoperability between systems and applications. Web services are typically invoked by enterprise applications to perform some extended functionality not otherwise available in the enterprise application itself. The enterprise applications and their associated enterprise systems are often referred to as “clients” of the web services that they invoke.
Typically, clients of web services must identify a particular implementation of a web service to invoke. Identification of the particular implementation of a web service to invoke is typically performed at design time, i.e. at the time that the enterprise applications/system is being designed. In other words, the bindings with a particular web services are set at design time and new bindings cannot be added at runtime.
International Business Machines, Inc. (IBM) has developed the Web Services Invocation Framework (WSIF) which is a tool that provides a standard application program interface (API) for invoking services described in the Web Services Description Language (WSDL), no matter how or where the services are provided. WSDL is a standard language used to describe a Web service. Co-developed by Microsoft and IBM, WSDL describes the protocols and formats used by the service. WSDL descriptions can be referenced in a Universal Description, Discovery and Integration (UDDI) directory in order to promote the use of Web services worldwide.
The WSIF architecture enables developers to interact with WSDL-based representations of Web services instead of working directly with the Simple Object Access Protocol (SOAP) APIs, which is the usual programming model. With WSIF, developers can work with the same programming model regardless of how the Web service is implemented and accessed.
The WSIF architecture also allows stub-based and stub-less invocation of Web services. A stub is a small software routine placed into a program that provides a common function. Stubs are used for a variety of purposes. For example, a stub may be installed in a client machine, and a counterpart installed in a server, where both are required to resolve some protocol, remote procedure call (RPC) or other interoperability requirement. With the WSIF architecture, no stub is necessary, and the services can be dynamically invoked.
Using WSIF, a client passes a WSDL description of a desired web service to a service factory. The service factory generates a “proxy” for the web service that corresponds to the service element in the WSDL description. The service element defines a number of ports, each of which corresponds to a different format and protocol, that can be used to access the web service described by the WSDL. Typically, all ports map a particular WSDL portType. A “portType” in WSDL is a collection of operations that have been previously defined for a service interface. Known WSIF allows the client to select the port of the service or allows the port to be automatically selected at runtime, but supports only a default selection of the first port encountered. Thus, if more than one port are associated with a particular service, the first port will always be selected.
Once the desired port is identified, it is then used by the client to identify an operation. Eventually, the client calls an “execute” method on the identified operation to actually invoke the service implementation.
Thus, with known service invocation frameworks, the implementation of a web service that is to be invoked is set at design time, or can be explicitly chosen by the client at run time, such as in WSIF. The known systems do not provide an ability to dynamically discover and select a particular implementation of a web service at runtime without explicit action on the part of the client. Furthermore, known systems do not allow for discovery and selection of implementations of services from a group of similar services based on selection preferences without explicit action on the part of the client.
In view of the above, it would be beneficial to have an apparatus and method for dynamic selection of implementations of web services at runtime. It would further be beneficial to have an apparatus and method for determining when such dynamic selection is to be performed and when prior selections of web services should be utilized.